import 'package:flutter/cupertino.dart';
import 'package:flutter_spider_fx/framework/network.dart';
import 'package:flutter_spider_fx/framework/task.dart';

class DouYinSpider extends SpiderTask {
  var url = 'https://v.douyin.com/idoG6UTD/';

  DouYinSpider(BuildContext context) : super(context, 'DouYin Spider');

  @override
  Future doLogic() async {
    logging.debug('你倒是显示出来啊！');
    var dom = await CatHttp.getDocument(url);
    logging.debug(dom.outerHtml);
    var links = dom.querySelectorAll(".hot-list ul li a");
    links.forEach((links) {
      logging.verbose(links.attributes['href']!);
      logging.debug(links.text);
    });
  }
}
